home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
BGRAPHV.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
3KB
|
102 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_BarGraphV(TopRow,TopCol,BotRow,BotCol,Degree_Prcnt,Fore_Char,Back_Char,Fore_
Color,Back_Color,Final_Only,Use_Zero) --> NIL
PARAMETERS:
TopRow : Top Row (Maximum range) of Bargraph
TopCol : Top Left Column of Bargraph
BotRow : Bottom Row (Minimum Range) of Bargraph
BotCol : Bottom Right Column of Bargraph
Degree_Prcnt : Percent of Bar to Graph
Fore_Char : Graph Charcater (what to draw with)
Back_Char : Background Character (what to draw on)
Fore_color : ForeGround Color to Use
Back_Color : background Color to Use
Final_Only : Log - Print Whole Bar or just Top Character
Use_Zero : Log - Graph Bottom char if:
Min_Inc_Characters < Degree_Percent
SHORT:
Provides a verticle BarGraph based upon "percent."
DESCRIPTION:
_BarGraphV draw a VERTICLE bargraph with minimum and maximum ranges at
the given coordinates. It then displays the bargraph "Degree_Prcnt"
percent of the min/max values.
For instance, if the BarGraph range is from row 4 down to row 13 (ten
rows) and Degree_Prcnt = 50, then 50% of the bargraph will be filled from
the bottom Row 13 UP TO Row 9.
The Bargraph will be drawn using character Fore_Char and the remaining
unused range of the Bargraph will be drawn using Back_Char.
The Fore_Char will be drawn using the color specified in the
Fore_Color parameter and the back_Char will be drawn using the color
specified in the Back_Color parameter.
If the percent to be graphed is less than can be displayed in a
single character of the bargraph, USE_ZERO = .T. will cause the
bottom-most character to be graphed anyway.
NOTE:
See KLIPPER.CH for alternate calling conventions using #xtrans.
EXAMPLE:
#define DEGREE 67
_Box(1,22,24,24)
@ 02,25 say '100 %'+' (' + ltrim(str(DEGREE)) + '% COMPLETE)'
@ 08,25 say ' 75 %'
@ 13,25 say ' 50 %'
@ 18,25 say ' 25 %'
@ 23,25 say ' 0 %'
_BarGraphV(02,23,23,23,DEGREE,'░','─',,'b/n')
Result: A graph similar to the following is built:
┌───┐
│ ─ │ 100% (67% Complete)
│ ─ │
│ ─ │
│ ─ │
│ ─ │
│ ─ │
│ ─ │ 75%
│ ─ │
│ ░ │
│ ░ │
│ ░ │
│ ░ │ 50%
│ ░ │
│ ░ │
│ ░ │
│ ░ │
│ ░ │ 25%
│ ░ │
│ ░ │
│ ░ │
│ ░ │
│ ░ │ 0%
└───┘
Notice that the _BarGraphV() function is responsible only for the
actual bargraph itself. The box and the labels were drawn manually.
******************************************************************************/